<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib uri="/struts-tags" prefix="s"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>修改月之星</title>
		<style type="text/css">
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}

a {
	font-size: 12px;
	color: #000;
	text-decoration: none;
}

a:hover {
	color: #CA5466;
	text-decoration: underline;
}

.STYLE1 {
	font-size: 12px
}

.STYLE3 {
	font-size: 12px;
	font-weight: bold;
}

.STYLE4 {
	color: #03515d;
	font-size: 12px;
}

.td_bg {
	font-size: 13px;
	background: #fff;
	border: 1px solid #6495ED;
}

/*表单项的字体格式*/
.td_x_bg {
	font-size: 13px;
	font-weight: bold;
	text-align: center;
	background: #BDE3FB;
	border: 1px solid #6495ED;
	height: 40px;
}

.table {
}
.x_bg {
	font-size: 12px;
	text-align: center;
	background: #BDE3FB;
	border: 1px solid #6495ED;
}
.bg {
	font-size: 12px;
	background: #fff;
	border: 1px solid #6495ED;
}
</style>
		<script type="text/javascript" src="js/jquery.js"></script>
		<script type="text/javascript" src="js/checkUtil.js"></script>
		<script>
			var ifCanMove = false;
			var mousePos;
			document.onmousemove = mouseMove;

			function mouseMove(ev){
				ev = ev || window.event;
				mousePos = mousePosition(ev);
			}
			
			function mousePosition(ev) {
				if (ev.pageX || ev.pageY) {
					return {x:ev.pageX,y:ev.pageY};
				}
				return {
					x:ev.clientX+document.body.scrollLeft - document.body.clientLeft,
					y:ev.clientY+document.body.scrollTop - document.body.clientTop
				}
			}
			
			var addStar = function() {
				var bookName = $.trim($("#bookName").val());
				var description = $.trim($("#description").val());
				
				if(bookName == '') {
					alert("请填写书籍名称!");
					return false;
				}else if(description == '') {
					alert("请填写组长评语!");
					return false;
				}
				
				return true;
			}
		</script>

	</head>

	<body>
		<s:if test="%{#addwrong == 0}">
			<script language = "javascript">
		         alert("请选定一个队员！");
		    </script>
		</s:if>
		<s:elseif test="%{#addwrong == 1}">
		   <script language = "javascript">
		         alert("请添加书籍名称！");
		    </script>
		</s:elseif>
		<s:elseif test="%{#addwrong == 2}">
		   <script language = "javascript">
		         alert("请填写组长评语！");
		    </script>
		</s:elseif>
		<s:elseif test="%{#addwrong == 3}">
		   <script language = "javascript">
		         alert("修改失败！");
		    </script>
		</s:elseif>
		<s:elseif test="%{#addwrong == 4}">
			<script language = "javascript">
		         alert("修改成功！");
		    </script>
		</s:elseif>
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
			<tr>
				<td height="30" background="images/main/tab_05.gif">
					<table width="100%" border="0" cellspacing="0" cellpadding="0">
						<tr>
							<td width="12" height="30">
								<img src="images/main/tab_03.gif" width="12" height="30" />
							</td>
							<td>
								<table width="100%" border="0" cellspacing="0" cellpadding="0">
									<tr>
										<td width="46%" valign="middle">
											<table width="100%" border="0" cellspacing="0"
												cellpadding="0">
												<tr>
													<td width="5%">
														<div align="center">
															<img src="images/main/tb.gif" width="16" height="16" />
														</div>
													</td>
													<td width="95%" class="STYLE1">
														<span class="STYLE3">你当前的位置</span>：[风云榜]-[修改月之星]
													</td>
												</tr>
											</table>
										</td>
										<td width="54%">
											<table border="0" align="right" cellpadding="0"
												cellspacing="0">
												<tr>
													<td width="80">
														<table width="90%" border="0" cellpadding="0"
															cellspacing="0">
															<tr>
																<td>
																</td>
															</tr>
														</table>
													</td>
													<td width="40">
														<table width="90%" border="0" cellpadding="0"
															cellspacing="0">
															<tr>
																<td class="STYLE1"></td>
																<td class="STYLE1">
																	<br>
																</td>
															</tr>
														</table>
													</td>
												</tr>
											</table>
										</td>
									</tr>
								</table>
							</td>
							<td width="16">
								<img src="images/main/tab_07.gif" width="16" height="30" />
							</td>
						</tr>
					</table>
				</td>
			</tr>
			<tr>
				<td>
					<table width="100%" border="0" cellspacing="0" cellpadding="0">
						<tr>
							<td width="8" background="images/main/tab_12.gif">
								&nbsp;
							</td>
							<td>
								<s:iterator value="stars" var="stars">
								<form action="front/modifyStar.action" method="post" onsubmit="return addStar()">
								<table class="table" border="1" width="70%" align="center"
									cellpadding="2" cellspacing="2" bordercolor="#6495ED">
									<tbody>
										<tr>
											<td class="td_x_bg" colspan="4">
												<nobr>
													修改 <s:property value="#stars.user.group.groupName" />组最佳队员
												</nobr>
											</td>
										</tr>
										<tr>
											<td  width=120 class="td_x_bg" >
												期号
											</td>
											<td class="td_bg" width=120 >
												<s:property value="#stars.qishu" />
											</td>
											<td width=120 class="td_x_bg">
												奖励书籍
											</td>
											<td class="td_bg">
												<input type="text" name="star.bookName" value="<s:property value="#stars.bookName" />" id="bookName"style="width:350px">
											</td>
										</tr>
										<tr>
											<td  width=120 class="td_x_bg" >
												队员列表
											</td>
											<td class="td_bg" colspan="3">
													
													<s:iterator value="(#stars.user.group.id == 2)?(memList.javaMember):(memList.phpMember)" var="memberList" >
													
												<input type="radio" name="star.user.id" value="<s:property value="#memberList.id"/>" <s:if test="#memberList.id == #stars.user.id">checked="checked"</s:if> /><span><span style="cursor:pointer;" onmousemove="{
														parentNode.children[1].style.display='block'
														parentNode.children[1].style.left = mousePos.x + 10 + 'px';
														parentNode.children[1].style.top = mousePos.y + 20 + 'px';
														}"
														onmouseout="parentNode.children[1].style.display='none'"><s:property value="#memberList.name"/></span>
														<div style="font-size:13px;display:none;position:absolute;background:#fff;">
															<table border="0"  align="center" width="250"
																cellpadding="2" cellspacing="0" bordercolor="#6495ED">
																<tbody>
																	<tr>
																		<td class="bg" rowspan="5" valign="top" align="center">
																			<nobr>
																				头像<br />
																				<img src=<s:property value="#memberList.headImg.imgSrc" /> width="60" />
																			</nobr>
																		</td>
																		<td class="x_bg">
																			<nobr>
																				姓名
																			</nobr>
																		</td>
																		<td class="bg">
																			<nobr>
																				<s:property value="#memberList.name"/>
																			</nobr>
																		</td>
																		<td class="x_bg">
																			<nobr>
																				加入时间
																			</nobr>
																		</td>
																		<td class="bg">
																			<nobr>
																				<s:date name="#memberList.joinTime" format="yyyy-MM-dd" nice="false"/>
																			</nobr>
																		</td>
																		
																	</tr>
																	<tr>
																		<td class="x_bg">
																			<nobr>
																				性别
																			</nobr>
																		</td>
																		<td class="bg">
																			<nobr>
																				男
																			</nobr>
																		</td>
																		<td class="x_bg">
																			<nobr>
																				所属组名
																			</nobr>
																		</td>
																		<td class="bg">
																			<nobr>
																				<s:property value="#memberList.group.groupName"/>
																			</nobr>
																		</td>
																	</tr>
																	<tr>
																		<td class="x_bg">
																			<nobr>
																				手机号码
																			</nobr>
																		</td>
																		<td class="bg">
																			<nobr>
																				<s:property value="#memberList.phone"/>
																			</nobr>
																		</td>
																		<td class="x_bg">
																			<nobr>
																				专业
																			</nobr>
																		</td>
																		<td class="bg">
																			<nobr>
																				<s:property value="#memberList.major"/>
																			</nobr>
																		</td>
																	</tr>
																	<tr>
																		<td class="x_bg">
																			<nobr>
																				QQ
																			</nobr>
																		</td>
																		<td class="bg">
																			<nobr>
																				<s:property value="#memberList.qq"/>
																			</nobr>
																		</td>
																		<td class="x_bg">
																			<nobr>
																				登录次数
																			</nobr>
																		</td>
																		<td class="bg">
																			<nobr>
																				<s:property value="#memberList.logintime"/>
																			</nobr>
																		</td>
																	</tr>
																	<tr>
																		<td class="x_bg">
																			<nobr>
																				积分
																			</nobr>
																		</td>
																		<td class="bg">
																			<nobr>
																				<s:property value="#memberList.jiFen"/>
																			</nobr>
																		</td>
																		<td class="x_bg">
																			<nobr>
																				等级
																			</nobr>
																		</td>
																		<td class="bg">
																			<nobr>
																				<s:if test="#memberList.jiFen > 10000" >
																					元老
																				</s:if>
																				<s:elseif test="#memberList.jiFen > 5000">
																					高官
																				</s:elseif>
																				<s:elseif test="#memberList.jiFen > 1000" >
																					三星平民
																				</s:elseif>
																				<s:elseif test="#memberList.jiFen > 500" >
																					二星平民
																				</s:elseif>
																				<s:elseif test="#memberList.jiFen > 100">
																					一星平民
																				</s:elseif>
																				<s:else>
																					平民
																				</s:else>
																			</nobr>
																		</td>
																	</tr>
																</tbody>
															</table>
														</div>
												</span>
												</s:iterator>
											</td>
										</tr>
										<tr>
											<td class="td_x_bg" >
												组长评语
											</td>
											<td class="td_bg" colspan="3">
												<textarea name="star.description" id="description" rows = 10 cols="60"><s:property value="#stars.description" /></textarea>
											</td>
										</tr>
										<tr>
											<td class="td_x_bg" colspan="4" >
												<input type="hidden" name="qishu" value=<s:property value="#stars.qishu" />>
												<input type="hidden" name="star.groupId" value=<s:property value="#stars.user.group.id" />>
												<input type="submit" value="修改" style="width:80px;height:30px;"/>
												<input type="reset" value="重置" style="width:80px;height:30px;"/>
											</td>
										</tr>
									</tbody>
								</table>
								</form>
								</s:iterator>
							</td>
							<td width="8" background="images/main/tab_15.gif">
								&nbsp;
							</td>
						</tr>
					</table>
				</td>
			</tr>
			<tr>
				<td height="35" background="images/main/tab_19.gif">
					<table width="100%" border="0" cellspacing="0" cellpadding="0">
						<tr>
							<td width="12" height="35">
								<img src="images/main/tab_18.gif" width="12" height="35" />
							</td>
							<td>
								<form action="" method="get">
									<table width="100%" border="0" cellspacing="0" cellpadding="0">
										<tr>
											<td>
												&nbsp;
											</td>
										</tr>
									</table>
								</form>
							</td>
							<td width="16">
								<img src="images/main/tab_20.gif" width="16" height="35" />
							</td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
	</body>
</html>
